package webshop.controller.action;

import webshop.model.bl.ProductManager;
import webshop.model.db.Product;

import com.opensymphony.xwork2.ActionSupport;

public class ProductDetailAction extends ActionSupport {

	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5650522374530925052L;
	private Product product;
	private int productId;
	
	public String execute() {
		product = new ProductManager().getProductById(productId);
		return SUCCESS;
	}

	public void setProductId(int productId) {
		this.productId = productId;
	}

	public String getProductName() {
		return product.getName();
	}
	
	public int getDeliveryTime() {
		return product.getDeliveryTime();
	}
	
	public String getDescription() {
		return product.getDescription();
	}
	
	public double getPrice() {
		return product.getPrice();
	}
	
	public int getStock() {
		return product.getStock();
	}

}
